#include <stdio.h>
#include <stdlib.h>
#include <math.h>

unsigned short prime_list[200];

int prime(unsigned char m, unsigned char n);
int is_prime(unsigned short);
void prime_list_create();
int main()
{
    prime_list_create();
    unsigned char m, n;
    scanf("%hhd %hhd", &m, &n);
    int sum = prime(m, n);
    printf("sum:%d\n", sum);
    
    return 0;
}

int is_prime(unsigned short num)
{
    for(unsigned short i = 2; i <= sqrt(num); i++)
    {
        if (num % i == 0) return 0;
    }
    return 1;
}

void prime_list_create()
{
    unsigned short num = 2;
    unsigned short * flag = prime_list;
    int cnt = 0;
    for (unsigned short i = 2; i < 1200; i++)
    {
        if(is_prime(i))
        {
            *flag = i;
            flag++;
            cnt++;
        }
        if(cnt == 200) break;
    }
}

int prime(unsigned char m, unsigned char n)
{
    unsigned short sum = 0;
    for (unsigned short i = m-1; i <= n-1; i++)
    {
        sum += prime_list[i];
    }
    return sum;
}